<?php
namespace Admin\Form;

use Zend\Form\Form;
use Zend\Db\Adapter\AdapterInterface;

class GiaovienForm extends Form
{
	protected $dbAdapter;
    public function __construct(AdapterInterface $dbAdapter)
    {
		$this->setDbAdapter($dbAdapter);
        // we want to ignore the name passed
        parent::__construct('giaovien');

        $this->setAttribute('method', 'post');
        $this->add(array(
            'name' => 'id',
            'attributes' => array(
                'type'  => 'hidden',
            ),
        ));

        $this->add(array(
            'name' => 'magv',
            'attributes' => array(
				'id' => 'magv',
                'type'  => 'text',
				'required' => 'required',
            ),
            'options' => array(
                'label' => 'Mã giáo viên',
            ),
        ));

        $this->add(array(
            'name' => 'tengv',
            'attributes' => array(
				'id' => 'tengv',
                'type'  => 'text',
				'required' => 'required',
            ),
            'options' => array(
                'label' => 'Họ tên',
            ),
        ));
		
		$this->add(array(
			'type'  => 'radio',
			'name'  => 'gioitinh',
			'options' => array(
				'value_options' => array(
					'1' => array(
						'label' => 'Nam',
						'value' => 'Nam',
						'selected' => 'selected',
						'attributes' => array(
							'data-item' => '1',
						),
					),
					'0' => array(
						'label' => 'Nữ',
						'value' => 'Nữ',
						'attributes' => array(
							'data-item' => '0',
						),
					),
				),
				
			),
		));
		
		

        $this->add(array(
            'name' => 'submit',
            'attributes' => array(
                'type'  => 'submit',
                'value' => 'Go',
                'id' => 'submitbutton',
            ),
        ));

    }
	
	
	public function setDbAdapter(AdapterInterface $dbAdapter)
    {
        $this->dbAdapter = $dbAdapter;

        return $this;
    }

    public function getDbAdapter()
    {
        return $this->dbAdapter;
    }
}
